import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import '@/styles/index.scss' // global css

// set ElementUI lang to zh-CN
Vue.use(ElementUI, { locale })

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import * as filters from './filters' // 全局过滤器
import './core/use'

// 启动参数
import bootstrap from './core/bootstrap'

// 全局权限指令
import './core/directive/action'

Vue.config.productionTip = false

// 注册过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

new Vue({
  el: '#app',
  router,
  store,
  created: bootstrap,
  render: h => h(App)
})
